package com.scuec.groupfive.service.impl;

import com.scuec.groupfive.mapper.PostLikeMapper;
import com.scuec.groupfive.service.PostLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;

@Service
public class PostLikeServiceImpl implements PostLikeService {
    @Autowired
    private PostLikeMapper postLikeMapper;

    @Override
    public int getTotalLikeCount() {
        return postLikeMapper.getTotalLikeCount();
    }

    @Override
    public int getLikeCountByDateRange(Date startDate, Date endDate) {
        endDate = new Date(endDate.getTime() + 24 * 60 * 60 * 1000 - 1);
        return postLikeMapper.getLikeCountByDateRange(startDate, endDate);
    }
}